<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Thymeleaf learn</title>
    <!-- 关键代码 -->
    <script th:src="@{/webjars/jquery/3.2.1/dist/jquery.min.js}"></script>
    <script th:src="@{/webjars/bootstrap/4.3.1/js/bootstrap.min.js}"></script>
    <link rel="stylesheet" th:href="@{/webjars/bootstrap/4.3.1/css/bootstrap.min.css}" />
    <link type="text/css" rel="stylesheet" th:href="@{/static/css/style.css}">
</head>
<body>
<h1>Hello! Thymeleaf</h1>
<img id="img1" alt="看到我说明图片挂了" th:src="@{/static/imgs/dog.jpg}"
     title="帅哥一枚"
     width="10%" height="10%" class="rounded-circle">
<button id="btn1" class="btn btn-info">Click Me!</button>
<div id="div1"></div>
<script type="text/javascript">
    $("#btn1").click(function(){
        $("#img1").attr({"src":"[[@{/}]]/static/imgs/rabbit.jpg", "title":"小姐姐一名"});
            let val = $("#div1").html();
            if(val.length == 0)
        $("#div1").html("被点出来了...").css({"color":"silver", "fontsize": "24px"});
            else if(val != '')
        $("#div1").html("");
    });
</script>

<hr>
<form th:action="@{file/upload}" method="post" enctype="multipart/form-data">
    <input type="file" name="myFile">
    <input type="submit" value="上传">
</form>
</body>
</html>